<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>物资借还查看</title>
    
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <div class="col-sm-2"></div>
	<div class="col-sm-6">

        <!-- 开始 -->
        <div class="view-items">
            <div class="view-mark i-start"><span class="v-start">开始借出</span><span class="v-target"></span></div>
            <div class="view-main">
                <div class="view-info">
                    <p>${ appMaterialsLend.orgName}&nbsp;&nbsp;${ appMaterialsLend.agentName}</p>
                    <p class="v-time">${ appMaterialsLend.lendTimeStr }</p>
                </div>
                <div class="view-pic">
                    <div class="v-click" onclick="showLendPdf('${appMaterialsLend.id}');">点击查看大图</div>
                    <img src="static/images/test1.jpg">
                </div>
            </div>
        </div>
        <c:if test="${size == 0 }">
	        <div class="view-items">
	            <div class="view-mark"><span class="v-end diss">归还结束</span><span class="v-target"></span></div>
	            <div class="view-main">
	                <div class="view-info">
	                </div>
	            </div>
	        </div>
        </c:if>
        <c:forEach var="obj" items="${appMaterialsReturnList}" varStatus="i">
	        <c:choose>
	        	<c:when test="${i.last}"><!-- 最后一条记录 -->
	        		<c:choose>
	        			<c:when test="${ appMaterialsLend.lendStatus == '2' }">
	        				<div class="view-items">
					            <div class="view-mark"><span class="v-end">归还结束</span><span class="v-target"></span></div>
					            <div class="view-main">
					                <div class="view-info">
					                    <p>${ appMaterialsLend.orgName}&nbsp;&nbsp;${obj.agentName}</p>
					                    <p class="v-time">${ obj.returnTimeStr }</p>
					                </div>
					                <div class="view-pic">
					                    <div class="v-click" onclick="showPdf('${obj.id}');">点击查看大图</div>
					                    <img src="static/images/test1.jpg">
					                </div>
					            </div>
				        	</div>
	        			</c:when>
	        			<c:otherwise>
		        			<div class="view-items">
					            <div class="view-mark i-start"><span class="v-back"><i>归还</i></span><span class="v-target"></span></div>
					            <div class="view-main">
					                <div class="view-info">
					                    <p>${appMaterialsLend.orgName}&nbsp;&nbsp;${obj.agentName}</p>
					                    <p class="v-time">${ obj.returnTimeStr }</p>
					                </div>
					                <div class="view-pic">
					                    <div class="v-click" onclick="showPdf('${obj.id}');">点击查看大图</div>
					                    <img src="static/images/test1.jpg">
					                </div>
					            </div>
				        	</div>
				        	<div class="view-items">
					            <div class="view-mark"><span class="v-end diss">归还结束</span><span class="v-target"></span></div>
					            <div class="view-main">
					                <div class="view-info">
					                </div>
					            </div>
					        </div>
		        		</c:otherwise>
	        		</c:choose>
	        		
	        	</c:when>
	        	<c:otherwise>
	        		<div class="view-items">
			            <div class="view-mark i-start"><span class="v-back"><i>归还</i></span><span class="v-target"></span></div>
			            <div class="view-main">
			                <div class="view-info">
			                    <p>${ appMaterialsLend.orgName}&nbsp;&nbsp;${obj.agentName}</p>
			                    <p class="v-time">${ obj.returnTimeStr }</p>
			                </div>
			                <div class="view-pic">
			                    <div class="v-click" onclick="showPdf('${obj.id}');">点击查看大图</div>
			                    <img src="static/images/test1.jpg">
			                </div>
			            </div>
		        	</div>
	        	</c:otherwise>
	        </c:choose>
        </c:forEach>

        <!-- 归还 yes-->
        <!-- <div class="view-items">
            <div class="view-mark i-start"><span class="v-back"><i>归还</i></span><span class="v-target"></span></div>
            <div class="view-main">
                <div class="view-info">
                    <p>技术营&emsp;王超</p>
                    <p class="v-time">2018-01-23</p>
                </div>
                <div class="view-pic">
                    <div class="v-click">点击查看大图</div>
                    <img src="static/images/test1.jpg">
                </div>
            </div>
        </div> -->

        <!-- 归还 no-->
        <!-- <div class="view-items">
            <div class="view-mark i-start"><span class="v-back diss"><i>归还</i></span><span class="v-target"></span></div>
            <div class="view-main">
                <div class="view-info">
                    <p>技术营&emsp;王超</p>
                    <p class="v-time">2018-01-23</p>
                </div>
                <div class="view-pic">
                    <div class="v-click">点击查看大图</div>
                    <img src="static/images/test1.jpg">
                </div>
            </div>
        </div> -->

        <!-- 结束 yes -->
        <!-- <div class="view-items">
            <div class="view-mark"><span class="v-end">归还结束</span><span class="v-target"></span></div>
            <div class="view-main">
                <div class="view-info">
                    <p>技术营&emsp;王超</p>
                    <p class="v-time">2018-01-23</p>
                </div>
                <div class="view-pic">
                    <div class="v-click">点击查看大图</div>
                    <img src="static/images/test1.jpg">
                </div>
            </div>
        </div> -->

        <!-- 结束 no-->
        <!-- <div class="view-items">
            <div class="view-mark"><span class="v-end diss">归还结束</span><span class="v-target"></span></div>
            <div class="view-main">
                <div class="view-info">
                    <p>技术营&emsp;王超</p>
                    <p class="v-time">2018-01-23</p>
                </div>
                <div class="view-pic">
                    <div class="v-click">点击查看大图</div>
                    <img src="static/images/test1.jpg">
                </div>
            </div>
        </div> -->

        <!-- 遍历结束 -->
    </div>

</div><!--/#main-container-->

<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
    	
    });
    
    // 查看签署的出借单详情
    function showLendPdf(id){
    	var option={
            url:"appMaterialsLend/lendPrintSigned/"+id,
            title:"查看借还单",
            width:"60%",
            height:"90%"
        };
        openIframe(option);
    }
    
    function showPdf(id){
    	var option={
            url:"appMaterialsReturn/returnSignPrint/"+id,
            title:"查看借还单",
            width:"60%",
            height:"90%"
        };
        openIframe(option);
    }
    
    
</script>
<!-- script end -->
</body>
</html>
